 			var careerSelected;
 			
 			function printDotViz(){
	            var options = {
	                    title: 'Notas del ITBA',
	                    hAxis: {title: 'Fecha', viewWindow:{min: new Date(minViewYear,0,1), max: new Date(maxViewYear, 0, 1)}, viewWindowMode: 'explicit'},
	                    vAxis: {title: 'Nota', viewWindow:{min: min_avg, max: max_avg+1}, viewWindowMode: 'explicit'},
	                    legend: 'true'
	                  };
	            
	            annotatedtimeline = new google.visualization.ScatterChart(document.getElementById('chart_div'));
	        //    var indexes = filter(dataViz,null,null,null,careerSelected,0,10);
	            var view = new google.visualization.DataView(dataViz);
	         //   view.hideColumns(indexes);

	            google.visualization.events.addListener(annotatedtimeline, 'select', selectDataFromChart);
	            annotatedtimeline.draw(view, options);
	        }
	        
/*	        function filter(dataTable, subjects, minDate, maxDate, career, minAvg, maxAvg) {
	        	var ret = [],j;
		        for(var i=1, j=0;i<dataTable.getNumberOfColumns();++i) {
			        var name = dataTable.getColumnLabel(i);
			        if(isSubject(name)) {
				        if(filterSubject(name, dataTable, subjects, minDate, maxDate, career, minAvg, maxAvg)) {
					        ret[j]=i;
					        j++;
				        }
			        }
			        else if(isAlumni(name)) {
				        if(filterAlumni(name, dataTable, subjects, minDate, maxDate, career, minAvg, maxAvg)) {
					        ret[j] = i;
					        j++;
				        }
			        }
			        else {
				        if(filterCareer(name, dataTable, subjects, minDate, maxDate, career, minAvg, maxAvg)) {
					        ret[j]=i;
					        j++;
				        }
			        }
		        }
		        alert(ret.length);
		        return ret;
	        }
 			
 			function filterCareer(name, dataTable, subjects, minDate, maxDate, career, minAvg, maxAvg) {
 				if(name  == "Min aprobacion") {
	 				return false;
 				}
 				if(career=="Ninguna") {
	 				return false;
 				}
	 			if(name==career) {
		 			return false;
	 			}
	 			return true;
 			}
 			
 			function filterSubject(name, dataTable, subjects, minDate, maxDate, career, minAvg, maxAvg) {
 				for(var i=0;i<alumni_grade.getNumberOfRows();++i) {
	 				var career2 = alumni_grade.getValue(i,6);
	 				var subject = alumni_grade.getValue(i,2);
	 				if(subject==name) {
		 				if(career==career2 && belongsList(subjects,name)) {
			 				return false;
		 				}
	 				}
 				}
 				return true;
 			}
 			
 			function filterAlumni(name, dataTable, subjects, minDate, maxDate, career, minAvg, maxAvg) {
	 			
 			}
 			
 			function belongsList(subjects,name) {
	 			for(var j=0;j<subjects.length();++j) {
		 			if(name==subjects[j]) {
			 			return true;
		 			}
	 			}
	 			return false;
 			}
 			
 			function filterAlumni() {
	 			return false;
 			}
 			
 			function radioUpdate() {
	 			for(var i=0;i<9;++i) {
		 			if(document.mayorForm.mayor[i].checked) {
		 				if(document.mayorForm.mayor[i].value == 'Ninguna') {
			 				careerSelected = 'Ninguna';
			 				break;
		 				}
		 				else {
				 			careerSelected = document.mayorForm.mayor[i].value;
			 				break;
			 			}
		 			}
	 			}
	 			printDotViz();
 			}
 			
 */			
 			
 			
 			
 			
	      	function initDotVisualization() {
	        	dataViz = new google.visualization.DataTable();
	        	dataViz.addColumn('date', 'Cuatrimestre');
	        	
	        	var allGrades = document.getElementById("all_grades");
		        if(allGrades.checked){
		        	addAllGradesInDot();
		        }
		        var minGrade = document.getElementById("min_grade");
		        if(minGrade.checked){
		        	addMinGradeInDot();
		        }
				
	      	}
	        
	      	function addMinGradeInDot(){
	        	minGradeCol = dataViz.addColumn('number', 'Min aprobacion');
	        	for(year = minYear; year < maxYear; year ++){
					for(month = 0; month < 12; month ++){
						var row = dataViz.addRow();
						dataViz.setCell(row, 0, new Date(year, month, 1));
						dataViz.setCell(row, minGradeCol, 4); 
					}
				}
			}
	      	
	      	function addAllGradesInDot(){
	        	allGradesCol = dataViz.addColumn('number', 'Notas generales');
				var index = allGradesCol; 
				for (var j = 0; j < grades.getNumberOfRows(); j++) {					
					if(validGrade(grades.getValue(j, 4))){
						var row = dataViz.addRow();
						dataViz.setCell(row, index, grades.getValue(j, 4)); 
						dataViz.setCell(row, 0, grades.getValue(j, 3)); 
					}
						
				}
			}
	      	
	        function addCareerToDotViz(i) {
	        	var career = grouped_Career.getValue(i,0);
				var index = dataViz.addColumn('number', career);
				for (i = 0; i < career_subject.getNumberOfRows(); i++) {
 					if((career_subject.getValue(i, 1) == career)){	
						for (var j = 0; j < grades.getNumberOfRows(); j++) {					
							if((grades.getValue(j, 2) == career_subject.getValue(i, 0))){
								var row = dataViz.addRow();
								dataViz.setCell(row, index, grades.getValue(j, 4)); 
								dataViz.setCell(row, 0, grades.getValue(j, 3)); 
							}
							
						}
 					}	
				}
	        }      
	        
	        function addAlumniToDotViz(i) {
	        	var alumni = grouped_alumni.getValue(i,0);
				var index = dataViz.addColumn('number', alumni); 
				for (var j = 0; j < alumni_grade.getNumberOfRows(); j++) {					
					if((alumni_grade.getValue(j, 5) == alumni)){
						var row = dataViz.addRow();
						dataViz.setCell(row, index, alumni_grade.getValue(j, 4)); 
						dataViz.setCell(row, 0, alumni_grade.getValue(j, 3)); 
					}
						
				}	            
	        }	        
	        
	        function addSubjectToDotViz(i) {
	        	var subject = grouped_subjects.getValue(i,0);
				var index = dataViz.addColumn('number', subject); 
				for (var j = 0; j < grades.getNumberOfRows(); j++) {					
					if((grades.getValue(j, 2) == subject)){
						var row = dataViz.addRow();
						dataViz.setCell(row, index, grades.getValue(j, 4)); 
						dataViz.setCell(row, 0, grades.getValue(j, 3)); 
					}
						
				}	            
	        }
	        